/* $Id: Song.java,v 1.5 2007/10/29 15:21:35 gigabass Exp $
*
* Copyright (c) Guido Ludwig. All rights reserved.
* Use is subject to license terms.
*/

package de.guidoludwig.jtm.domain;

import javax.persistence.Embeddable;

import com.jgoodies.binding.beans.Model;

/**
 * Domain Object for a Song
 * 
 * @author <a href="mailto:jtrade@gigabss.de">Guido Ludwig</a>
 * @version $Revision: 1.5 $
 */
@Embeddable
public class Song extends Model {

	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	public static final String PROPERTY_NAME = "name";
	public static final String PROPERTY_LENGTH = "length";
	public static final String PROPERTY_POSITION = "position";
	
	private String name;
	private int length;
	private int position;
	
	public int getLength() {
		return length;
	}

	public void setLength(int length) {
		int oldValue = getLength();
		this.length = length;
		firePropertyChange(PROPERTY_LENGTH, oldValue, length);
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		String oldValue = getName();
		this.name = name;
		firePropertyChange(PROPERTY_NAME, oldValue, getName());
	}

	public int getPosition() {
		return position;
	}
	
	public void setPosition(int position) {
		int oldValue = getPosition();
		this.position = position;
		firePropertyChange(PROPERTY_POSITION, oldValue, getPosition());
	}
	
}
